//
//  Photo.m
//  reacticons
//
//  Created by Nong Trung Nghia on 9/10/12.
//
//

#import "Photo.h"
#import "Items.h"
@implementation Photo

@synthesize categoryName;
@synthesize photo75URL;
@synthesize photo100URL;
@synthesize photo250URL;
@synthesize photoCreatedDate;
@synthesize photoDownloaded;
@synthesize photoID;
@synthesize photoImage;
@synthesize photoName;
@synthesize photoRecentlyUsed;
@synthesize photoThumbnail;

- (void)parseFromItem:(Items*)item{
    for (NSString *key in [item allKeys]) {
        [self setValue:[item valueForKey:key] forKey:key];
    }

    
}

- (Items*)itemObject{
    Items * item = [[Items alloc] initWithKeys:[NSArray arrayWithObjects:
                                                @"categoryName",
                                                @"photo75URL",
                                                @"photo100URL",
                                                @"photo250URL",
                                                @"photoCreatedDate",
                                                @"photoDownloaded",
                                                @"photoID",
                                                @"photoImage",
                                                @"photoName",
                                                @"photoRecentlyUsed",
                                                @"photoThumbnail",
                                                nil]];
    
    for (NSString *key in [item allKeys]) {
        [item setValue:[self valueForKey:key] forKey:key];
    }
    
    return [item autorelease];
}

@end
